﻿# epoller_test/CMakeLists.txt
cmake_minimum_required(VERSION 3.10)

project(tcpserver_test)

# 添加调试标志
set(CMAKE_BUILD_TYPE Debug)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")

set(CMAKE_CXX_STANDARD 11)


# 添加可执行文件
add_executable(server 
    server.cc
    ${CMAKE_SOURCE_DIR}/../src/loopthreadpool.cpp
    ${CMAKE_SOURCE_DIR}/../src/loopthread.cpp
    ${CMAKE_SOURCE_DIR}/../src/buffer.cpp
    ${CMAKE_SOURCE_DIR}/../src/socket.cpp
    ${CMAKE_SOURCE_DIR}/../src/epoller.cpp
    ${CMAKE_SOURCE_DIR}/../src/channel.cpp
    ${CMAKE_SOURCE_DIR}/../src/eventloop.cpp
    ${CMAKE_SOURCE_DIR}/../src/timerwheel.cpp
    ${CMAKE_SOURCE_DIR}/../src/log.cpp
    ${CMAKE_SOURCE_DIR}/../src/connection.cpp
    ${CMAKE_SOURCE_DIR}/../src/acceptor.cpp
    ${CMAKE_SOURCE_DIR}/../src/tcpserver.cpp
)
# 添加头文件路径
target_include_directories(server PRIVATE 
    ${CMAKE_SOURCE_DIR}/../src
)

# 链接需要的库
target_link_libraries(server
    pthread
)


# 添加可执行文件
add_executable(client 
    client.cc
    ${CMAKE_SOURCE_DIR}/../src/socket.cpp
    ${CMAKE_SOURCE_DIR}/../src/log.cpp
)
# 添加头文件路径
target_include_directories(client PRIVATE 
    ${CMAKE_SOURCE_DIR}/../src
)

# 链接需要的库
target_link_libraries(client
    pthread
)
